{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-11-07T09:10:12.115976900Z",
     "start_time": "2025-11-07T09:10:12.100347600Z"
    }
   },
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import datetime\n",
    "\n",
    "from util.logUtil import Logger\n",
    "from util.commonUtil import data_preprocessing\n",
    "from sklearn.metrics import mean_absolute_error\n",
    "import matplotlib.ticker as mick\n",
    "import joblib\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.preprocessing import LabelEncoder#文字分类\n",
    "\n",
    "\n",
    "\"\"\"\n",
    "导包\n",
    "配置绘图\n",
    "\"\"\"\n",
    "plt.rcParams['font.family'] = 'SimHei'\n",
    "plt.rcParams['font.size'] = 15"
   ]
  },
  {
   "cell_type": "markdown",
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "706c11f6f8b6f1e0"
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "outputs": [
    {
     "data": {
      "text/plain": "   Attrition  Age     BusinessTravel              Department  \\\n0          0   37      Travel_Rarely  Research & Development   \n1          0   54  Travel_Frequently  Research & Development   \n2          1   34  Travel_Frequently  Research & Development   \n3          0   39      Travel_Rarely  Research & Development   \n4          1   28  Travel_Frequently  Research & Development   \n\n   DistanceFromHome  Education EducationField  EmployeeNumber  \\\n0                 1          4  Life Sciences              77   \n1                 1          4  Life Sciences            1245   \n2                 7          3  Life Sciences             147   \n3                 1          1  Life Sciences            1026   \n4                 1          3        Medical            1111   \n\n   EnvironmentSatisfaction  Gender  ...  RelationshipSatisfaction  \\\n0                        1    Male  ...                         3   \n1                        4  Female  ...                         1   \n2                        1    Male  ...                         4   \n3                        4  Female  ...                         3   \n4                        1    Male  ...                         1   \n\n   StandardHours StockOptionLevel  TotalWorkingYears TrainingTimesLastYear  \\\n0             80                1                  7                     2   \n1             80                1                 33                     2   \n2             80                0                  9                     3   \n3             80                1                 21                     3   \n4             80                2                  1                     2   \n\n   WorkLifeBalance  YearsAtCompany YearsInCurrentRole YearsSinceLastPromotion  \\\n0                4               7                  5                       0   \n1                1               5                  4                       1   \n2                3               9                  7                       0   \n3                3              21                  6                      11   \n4                3               1                  0                       0   \n\n   YearsWithCurrManager  \n0                     7  \n1                     4  \n2                     6  \n3                     8  \n4                     0  \n\n[5 rows x 31 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Attrition</th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>Gender</th>\n      <th>...</th>\n      <th>RelationshipSatisfaction</th>\n      <th>StandardHours</th>\n      <th>StockOptionLevel</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n      <th>WorkLifeBalance</th>\n      <th>YearsAtCompany</th>\n      <th>YearsInCurrentRole</th>\n      <th>YearsSinceLastPromotion</th>\n      <th>YearsWithCurrManager</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>0</td>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>77</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>3</td>\n      <td>80</td>\n      <td>1</td>\n      <td>7</td>\n      <td>2</td>\n      <td>4</td>\n      <td>7</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>0</td>\n      <td>54</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>1</td>\n      <td>33</td>\n      <td>2</td>\n      <td>1</td>\n      <td>5</td>\n      <td>4</td>\n      <td>1</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>34</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>147</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>4</td>\n      <td>80</td>\n      <td>0</td>\n      <td>9</td>\n      <td>3</td>\n      <td>3</td>\n      <td>9</td>\n      <td>7</td>\n      <td>0</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>0</td>\n      <td>39</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>...</td>\n      <td>3</td>\n      <td>80</td>\n      <td>1</td>\n      <td>21</td>\n      <td>3</td>\n      <td>3</td>\n      <td>21</td>\n      <td>6</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>28</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 31 columns</p>\n</div>"
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data=pd.read_csv('../data/train.csv')\n",
    "data.head(5)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T09:10:13.705395400Z",
     "start_time": "2025-11-07T09:10:13.664279500Z"
    }
   },
   "id": "57f504b0b9c9d4db"
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "outputs": [
    {
     "data": {
      "text/plain": "      Attrition\n0             0\n1             0\n2             1\n3             0\n4             1\n...         ...\n1095          0\n1096          0\n1097          0\n1098          1\n1099          1\n\n[1100 rows x 1 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Attrition</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 1 columns</p>\n</div>"
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y=data.iloc[:,0:1]#划分特征和标签\n",
    "y#显示标签"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T09:10:16.008253100Z",
     "start_time": "2025-11-07T09:10:15.998590800Z"
    }
   },
   "id": "1b3f81434d134949"
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "data": {
      "text/plain": "      Age     BusinessTravel              Department  DistanceFromHome  \\\n0      37      Travel_Rarely  Research & Development                 1   \n1      54  Travel_Frequently  Research & Development                 1   \n2      34  Travel_Frequently  Research & Development                 7   \n3      39      Travel_Rarely  Research & Development                 1   \n4      28  Travel_Frequently  Research & Development                 1   \n...   ...                ...                     ...               ...   \n1095   35      Travel_Rarely  Research & Development                23   \n1096   38      Travel_Rarely                   Sales                 2   \n1097   37      Travel_Rarely                   Sales                16   \n1098   22      Travel_Rarely  Research & Development                 7   \n1099   26  Travel_Frequently  Research & Development                 2   \n\n      Education EducationField  EmployeeNumber  EnvironmentSatisfaction  \\\n0             4  Life Sciences              77                        1   \n1             4  Life Sciences            1245                        4   \n2             3  Life Sciences             147                        1   \n3             1  Life Sciences            1026                        4   \n4             3        Medical            1111                        1   \n...         ...            ...             ...                      ...   \n1095          4        Medical              75                        3   \n1096          4      Marketing            1835                        2   \n1097          4      Marketing             868                        4   \n1098          1  Life Sciences            1878                        4   \n1099          3  Life Sciences            1053                        1   \n\n      Gender  JobInvolvement  ...  RelationshipSatisfaction StandardHours  \\\n0       Male               2  ...                         3            80   \n1     Female               3  ...                         1            80   \n2       Male               1  ...                         4            80   \n3     Female               2  ...                         3            80   \n4       Male               2  ...                         1            80   \n...      ...             ...  ...                       ...           ...   \n1095  Female               3  ...                         3            80   \n1096  Female               1  ...                         1            80   \n1097    Male               2  ...                         4            80   \n1098    Male               3  ...                         1            80   \n1099    Male               3  ...                         2            80   \n\n      StockOptionLevel TotalWorkingYears  TrainingTimesLastYear  \\\n0                    1                 7                      2   \n1                    1                33                      2   \n2                    0                 9                      3   \n3                    1                21                      3   \n4                    2                 1                      2   \n...                ...               ...                    ...   \n1095                 1                 4                      3   \n1096                 2                20                      4   \n1097                 2                 9                      2   \n1098                 0                 1                      2   \n1099                 1                 6                      2   \n\n      WorkLifeBalance YearsAtCompany YearsInCurrentRole  \\\n0                   4              7                  5   \n1                   1              5                  4   \n2                   3              9                  7   \n3                   3             21                  6   \n4                   3              1                  0   \n...               ...            ...                ...   \n1095                3              2                  2   \n1096                2              4                  2   \n1097                3              1                  0   \n1098                3              1                  0   \n1099                3              3                  2   \n\n      YearsSinceLastPromotion  YearsWithCurrManager  \n0                           0                     7  \n1                           1                     4  \n2                           0                     6  \n3                          11                     8  \n4                           0                     0  \n...                       ...                   ...  \n1095                        2                     2  \n1096                        0                     3  \n1097                        0                     0  \n1098                        0                     0  \n1099                        1                     2  \n\n[1100 rows x 30 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>Gender</th>\n      <th>JobInvolvement</th>\n      <th>...</th>\n      <th>RelationshipSatisfaction</th>\n      <th>StandardHours</th>\n      <th>StockOptionLevel</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n      <th>WorkLifeBalance</th>\n      <th>YearsAtCompany</th>\n      <th>YearsInCurrentRole</th>\n      <th>YearsSinceLastPromotion</th>\n      <th>YearsWithCurrManager</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>77</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>3</td>\n      <td>80</td>\n      <td>1</td>\n      <td>7</td>\n      <td>2</td>\n      <td>4</td>\n      <td>7</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>54</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>1</td>\n      <td>33</td>\n      <td>2</td>\n      <td>1</td>\n      <td>5</td>\n      <td>4</td>\n      <td>1</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>34</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>147</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>1</td>\n      <td>...</td>\n      <td>4</td>\n      <td>80</td>\n      <td>0</td>\n      <td>9</td>\n      <td>3</td>\n      <td>3</td>\n      <td>9</td>\n      <td>7</td>\n      <td>0</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>39</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>2</td>\n      <td>...</td>\n      <td>3</td>\n      <td>80</td>\n      <td>1</td>\n      <td>21</td>\n      <td>3</td>\n      <td>3</td>\n      <td>21</td>\n      <td>6</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>28</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>35</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>23</td>\n      <td>4</td>\n      <td>Medical</td>\n      <td>75</td>\n      <td>3</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>3</td>\n      <td>80</td>\n      <td>1</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>38</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>1835</td>\n      <td>2</td>\n      <td>Female</td>\n      <td>1</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>2</td>\n      <td>20</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>2</td>\n      <td>0</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>16</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>868</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>4</td>\n      <td>80</td>\n      <td>2</td>\n      <td>9</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>22</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1878</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>80</td>\n      <td>0</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>26</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>2</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1053</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>2</td>\n      <td>80</td>\n      <td>1</td>\n      <td>6</td>\n      <td>2</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 30 columns</p>\n</div>"
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=data.drop(columns=['Attrition'])#划分特征和标签\n",
    "x#显示特征\n",
    "x['BusinessTravel']"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T01:08:11.243524400Z",
     "start_time": "2025-11-07T01:08:11.210606400Z"
    }
   },
   "id": "2c9c0993572cf51f"
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\jinhao\\AppData\\Local\\Temp\\ipykernel_16368\\3976168879.py:5: FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.\n",
      "  x.groupby('age_bin').agg({'Attrition_bin':'mean'})\n"
     ]
    },
    {
     "data": {
      "text/plain": "         Attrition_bin\nage_bin               \n0-20          0.359649\n20-30         0.204852\n30-40         0.092437\n40-50         0.095808\n50-60         0.131868",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Attrition_bin</th>\n    </tr>\n    <tr>\n      <th>age_bin</th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0-20</th>\n      <td>0.359649</td>\n    </tr>\n    <tr>\n      <th>20-30</th>\n      <td>0.204852</td>\n    </tr>\n    <tr>\n      <th>30-40</th>\n      <td>0.092437</td>\n    </tr>\n    <tr>\n      <th>40-50</th>\n      <td>0.095808</td>\n    </tr>\n    <tr>\n      <th>50-60</th>\n      <td>0.131868</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#对age特征列进行分箱,并观察流失率\n",
    "x['age_bin']=pd.cut(x['Age'],bins=5,labels=['0-20','20-30','30-40','40-50','50-60'])\n",
    "#拼接标签对比\n",
    "x['Attrition_bin']=y\n",
    "x.groupby('age_bin').agg({'Attrition_bin':'mean'})\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T09:10:19.575990500Z",
     "start_time": "2025-11-07T09:10:19.541804200Z"
    }
   },
   "id": "9979443900d75448"
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [
    {
     "data": {
      "text/plain": "      Age     BusinessTravel              Department  DistanceFromHome  \\\n0      37      Travel_Rarely  Research & Development                 1   \n1      54  Travel_Frequently  Research & Development                 1   \n2      34  Travel_Frequently  Research & Development                 7   \n3      39      Travel_Rarely  Research & Development                 1   \n4      28  Travel_Frequently  Research & Development                 1   \n...   ...                ...                     ...               ...   \n1095   35      Travel_Rarely  Research & Development                23   \n1096   38      Travel_Rarely                   Sales                 2   \n1097   37      Travel_Rarely                   Sales                16   \n1098   22      Travel_Rarely  Research & Development                 7   \n1099   26  Travel_Frequently  Research & Development                 2   \n\n      Education EducationField  EmployeeNumber  EnvironmentSatisfaction  \\\n0             4  Life Sciences              77                        1   \n1             4  Life Sciences            1245                        4   \n2             3  Life Sciences             147                        1   \n3             1  Life Sciences            1026                        4   \n4             3        Medical            1111                        1   \n...         ...            ...             ...                      ...   \n1095          4        Medical              75                        3   \n1096          4      Marketing            1835                        2   \n1097          4      Marketing             868                        4   \n1098          1  Life Sciences            1878                        4   \n1099          3  Life Sciences            1053                        1   \n\n      Gender  JobInvolvement  ...  StockOptionLevel TotalWorkingYears  \\\n0       Male               2  ...                 1                 7   \n1     Female               3  ...                 1                33   \n2       Male               1  ...                 0                 9   \n3     Female               2  ...                 1                21   \n4       Male               2  ...                 2                 1   \n...      ...             ...  ...               ...               ...   \n1095  Female               3  ...                 1                 4   \n1096  Female               1  ...                 2                20   \n1097    Male               2  ...                 2                 9   \n1098    Male               3  ...                 0                 1   \n1099    Male               3  ...                 1                 6   \n\n      TrainingTimesLastYear WorkLifeBalance  YearsAtCompany  \\\n0                         2               4               7   \n1                         2               1               5   \n2                         3               3               9   \n3                         3               3              21   \n4                         2               3               1   \n...                     ...             ...             ...   \n1095                      3               3               2   \n1096                      4               2               4   \n1097                      2               3               1   \n1098                      2               3               1   \n1099                      2               3               3   \n\n      YearsInCurrentRole YearsSinceLastPromotion YearsWithCurrManager  \\\n0                      5                       0                    7   \n1                      4                       1                    4   \n2                      7                       0                    6   \n3                      6                      11                    8   \n4                      0                       0                    0   \n...                  ...                     ...                  ...   \n1095                   2                       2                    2   \n1096                   2                       0                    3   \n1097                   0                       0                    0   \n1098                   0                       0                    0   \n1099                   2                       1                    2   \n\n      age_bin  Attrition_bin  \n0       30-40              0  \n1       50-60              0  \n2       20-30              1  \n3       30-40              0  \n4       20-30              1  \n...       ...            ...  \n1095    30-40              0  \n1096    30-40              0  \n1097    30-40              0  \n1098     0-20              1  \n1099     0-20              1  \n\n[1100 rows x 32 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>Gender</th>\n      <th>JobInvolvement</th>\n      <th>...</th>\n      <th>StockOptionLevel</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n      <th>WorkLifeBalance</th>\n      <th>YearsAtCompany</th>\n      <th>YearsInCurrentRole</th>\n      <th>YearsSinceLastPromotion</th>\n      <th>YearsWithCurrManager</th>\n      <th>age_bin</th>\n      <th>Attrition_bin</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>77</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>1</td>\n      <td>7</td>\n      <td>2</td>\n      <td>4</td>\n      <td>7</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n      <td>30-40</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>54</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>33</td>\n      <td>2</td>\n      <td>1</td>\n      <td>5</td>\n      <td>4</td>\n      <td>1</td>\n      <td>4</td>\n      <td>50-60</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>34</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>147</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>1</td>\n      <td>...</td>\n      <td>0</td>\n      <td>9</td>\n      <td>3</td>\n      <td>3</td>\n      <td>9</td>\n      <td>7</td>\n      <td>0</td>\n      <td>6</td>\n      <td>20-30</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>39</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>2</td>\n      <td>...</td>\n      <td>1</td>\n      <td>21</td>\n      <td>3</td>\n      <td>3</td>\n      <td>21</td>\n      <td>6</td>\n      <td>11</td>\n      <td>8</td>\n      <td>30-40</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>28</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>20-30</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>35</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>23</td>\n      <td>4</td>\n      <td>Medical</td>\n      <td>75</td>\n      <td>3</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>30-40</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>38</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>1835</td>\n      <td>2</td>\n      <td>Female</td>\n      <td>1</td>\n      <td>...</td>\n      <td>2</td>\n      <td>20</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>2</td>\n      <td>0</td>\n      <td>3</td>\n      <td>30-40</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>16</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>868</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>2</td>\n      <td>9</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>30-40</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>22</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1878</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>0</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0-20</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>26</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>2</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1053</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>6</td>\n      <td>2</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>0-20</td>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 32 columns</p>\n</div>"
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T01:25:23.239146700Z",
     "start_time": "2025-11-07T01:25:23.204657200Z"
    }
   },
   "id": "47f34ee88e99311c"
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "列联表:\n",
      " Attrition_bin    0   1\n",
      "age_bin               \n",
      "0-20            73  41\n",
      "20-30          295  76\n",
      "30-40          324  33\n",
      "40-50          151  16\n",
      "50-60           79  12\n",
      "\n",
      "卡方值: 56.5974\n",
      "p 值: 0.0000\n",
      "924.5 180.5\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "#卡方检验（检验 Age 分箱 与 Attrition 是否相关）\n",
    "from scipy.stats import chi2_contingency\n",
    "# 生成列联表\n",
    "contingency = pd.crosstab(x['age_bin'], x['Attrition_bin'])\n",
    "\n",
    "print(\"列联表:\\n\", contingency)\n",
    "# 进行卡方检验\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)\n",
    "# 打印结果\n",
    "print(f\"\\n卡方值: {chi2:.4f}\")\n",
    "print(f\"p 值: {p:.4f}\")\n",
    "#进行woe转换,为逻辑回归做准备\n",
    "contingency+=0.5#避免分母为0\n",
    "good_total = contingency[0].sum()\n",
    "bad_total = contingency[1].sum()\n",
    "print(good_total,bad_total)\n",
    "woe_map = {}\n",
    "for bin_label in contingency.index:\n",
    "    good = contingency.loc[bin_label, 0]\n",
    "    bad = contingency.loc[bin_label, 1]\n",
    "    woe = np.log((good / good_total) / (bad / bad_total))\n",
    "    woe_map[bin_label] = woe\n",
    "\n",
    "# 步骤 3：用 WOE 替换原始 Age（或 age_bin）\n",
    "x['Age_WOE'] = x['age_bin'].map(woe_map)\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T01:47:10.113704500Z",
     "start_time": "2025-11-07T01:47:10.089584400Z"
    }
   },
   "id": "58ce9a414d735f23"
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "outputs": [
    {
     "data": {
      "text/plain": "      Age  BusinessTravel              Department  DistanceFromHome  \\\n0      37               2  Research & Development                 1   \n1      54               1  Research & Development                 1   \n2      34               1  Research & Development                 7   \n3      39               2  Research & Development                 1   \n4      28               1  Research & Development                 1   \n...   ...             ...                     ...               ...   \n1095   35               2  Research & Development                23   \n1096   38               2                   Sales                 2   \n1097   37               2                   Sales                16   \n1098   22               2  Research & Development                 7   \n1099   26               1  Research & Development                 2   \n\n      Education EducationField  EmployeeNumber  EnvironmentSatisfaction  \\\n0             4  Life Sciences              77                        1   \n1             4  Life Sciences            1245                        4   \n2             3  Life Sciences             147                        1   \n3             1  Life Sciences            1026                        4   \n4             3        Medical            1111                        1   \n...         ...            ...             ...                      ...   \n1095          4        Medical              75                        3   \n1096          4      Marketing            1835                        2   \n1097          4      Marketing             868                        4   \n1098          1  Life Sciences            1878                        4   \n1099          3  Life Sciences            1053                        1   \n\n      Gender  JobInvolvement  ...  TotalWorkingYears TrainingTimesLastYear  \\\n0       Male               2  ...                  7                     2   \n1     Female               3  ...                 33                     2   \n2       Male               1  ...                  9                     3   \n3     Female               2  ...                 21                     3   \n4       Male               2  ...                  1                     2   \n...      ...             ...  ...                ...                   ...   \n1095  Female               3  ...                  4                     3   \n1096  Female               1  ...                 20                     4   \n1097    Male               2  ...                  9                     2   \n1098    Male               3  ...                  1                     2   \n1099    Male               3  ...                  6                     2   \n\n      WorkLifeBalance YearsAtCompany  YearsInCurrentRole  \\\n0                   4              7                   5   \n1                   1              5                   4   \n2                   3              9                   7   \n3                   3             21                   6   \n4                   3              1                   0   \n...               ...            ...                 ...   \n1095                3              2                   2   \n1096                2              4                   2   \n1097                3              1                   0   \n1098                3              1                   0   \n1099                3              3                   2   \n\n      YearsSinceLastPromotion YearsWithCurrManager age_bin   Age_WOE  \\\n0                           0                    7   30-40  0.637218   \n1                           1                    4   50-60  0.216506   \n2                           0                    6   20-30 -0.282144   \n3                          11                    8   30-40  0.637218   \n4                           0                    0   20-30 -0.282144   \n...                       ...                  ...     ...       ...   \n1095                        2                    2   30-40  0.637218   \n1096                        0                    3   30-40  0.637218   \n1097                        0                    0   30-40  0.637218   \n1098                        0                    0    0-20 -1.061930   \n1099                        1                    2    0-20 -1.061930   \n\n      Attrition_bin  \n0                 0  \n1                 0  \n2                 1  \n3                 0  \n4                 1  \n...             ...  \n1095              0  \n1096              0  \n1097              0  \n1098              1  \n1099              1  \n\n[1100 rows x 33 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EmployeeNumber</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>Gender</th>\n      <th>JobInvolvement</th>\n      <th>...</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n      <th>WorkLifeBalance</th>\n      <th>YearsAtCompany</th>\n      <th>YearsInCurrentRole</th>\n      <th>YearsSinceLastPromotion</th>\n      <th>YearsWithCurrManager</th>\n      <th>age_bin</th>\n      <th>Age_WOE</th>\n      <th>Attrition_bin</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>37</td>\n      <td>2</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>77</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>7</td>\n      <td>2</td>\n      <td>4</td>\n      <td>7</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n      <td>30-40</td>\n      <td>0.637218</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>54</td>\n      <td>1</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1245</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>33</td>\n      <td>2</td>\n      <td>1</td>\n      <td>5</td>\n      <td>4</td>\n      <td>1</td>\n      <td>4</td>\n      <td>50-60</td>\n      <td>0.216506</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>34</td>\n      <td>1</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>147</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>1</td>\n      <td>...</td>\n      <td>9</td>\n      <td>3</td>\n      <td>3</td>\n      <td>9</td>\n      <td>7</td>\n      <td>0</td>\n      <td>6</td>\n      <td>20-30</td>\n      <td>-0.282144</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>39</td>\n      <td>2</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1026</td>\n      <td>4</td>\n      <td>Female</td>\n      <td>2</td>\n      <td>...</td>\n      <td>21</td>\n      <td>3</td>\n      <td>3</td>\n      <td>21</td>\n      <td>6</td>\n      <td>11</td>\n      <td>8</td>\n      <td>30-40</td>\n      <td>0.637218</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>28</td>\n      <td>1</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1111</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>20-30</td>\n      <td>-0.282144</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>35</td>\n      <td>2</td>\n      <td>Research &amp; Development</td>\n      <td>23</td>\n      <td>4</td>\n      <td>Medical</td>\n      <td>75</td>\n      <td>3</td>\n      <td>Female</td>\n      <td>3</td>\n      <td>...</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>2</td>\n      <td>30-40</td>\n      <td>0.637218</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>38</td>\n      <td>2</td>\n      <td>Sales</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>1835</td>\n      <td>2</td>\n      <td>Female</td>\n      <td>1</td>\n      <td>...</td>\n      <td>20</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>2</td>\n      <td>0</td>\n      <td>3</td>\n      <td>30-40</td>\n      <td>0.637218</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>37</td>\n      <td>2</td>\n      <td>Sales</td>\n      <td>16</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>868</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>2</td>\n      <td>...</td>\n      <td>9</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>30-40</td>\n      <td>0.637218</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>22</td>\n      <td>2</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>1878</td>\n      <td>4</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>1</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0-20</td>\n      <td>-1.061930</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>26</td>\n      <td>1</td>\n      <td>Research &amp; Development</td>\n      <td>2</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1053</td>\n      <td>1</td>\n      <td>Male</td>\n      <td>3</td>\n      <td>...</td>\n      <td>6</td>\n      <td>2</td>\n      <td>3</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>0-20</td>\n      <td>-1.061930</td>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 33 columns</p>\n</div>"
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#处理第二列\n",
    "le=LabelEncoder()\n",
    "x['BusinessTravel']=le.fit_transform(x['BusinessTravel'])\n",
    "#将第二列进行分类,将文字转化成数字\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:01:30.878690500Z",
     "start_time": "2025-11-07T02:01:30.852680100Z"
    }
   },
   "id": "d3cea85e6bd4d8b4"
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p 值: 0.0041\n"
     ]
    }
   ],
   "source": [
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['BusinessTravel'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)\n",
    "print(f\"p 值: {p:.4f}\")\n",
    "#p=0.0041,显著"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:03:17.351086200Z",
     "start_time": "2025-11-07T02:03:17.306465500Z"
    }
   },
   "id": "7d84685539b466fd"
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "outputs": [
    {
     "data": {
      "text/plain": "0       1\n1       1\n2       1\n3       1\n4       1\n       ..\n1095    1\n1096    2\n1097    2\n1098    1\n1099    1\nName: Department, Length: 1100, dtype: int32"
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x['Department']=le.fit_transform(x['Department'])\n",
    "x['Department']"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:04:43.929359100Z",
     "start_time": "2025-11-07T02:04:43.893423200Z"
    }
   },
   "id": "267997f5a83b4e11"
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'Department'",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3805\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3804\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m-> 3805\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_engine\u001B[38;5;241m.\u001B[39mget_loc(casted_key)\n\u001B[0;32m   3806\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n",
      "File \u001B[1;32mindex.pyx:167\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mindex.pyx:196\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7081\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7089\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Department'",
      "\nThe above exception was the direct cause of the following exception:\n",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[58], line 2\u001B[0m\n\u001B[0;32m      1\u001B[0m \u001B[38;5;66;03m#卡方求p值\u001B[39;00m\n\u001B[1;32m----> 2\u001B[0m contingency \u001B[38;5;241m=\u001B[39m pd\u001B[38;5;241m.\u001B[39mcrosstab(x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDepartment\u001B[39m\u001B[38;5;124m'\u001B[39m], x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mAttrition_bin\u001B[39m\u001B[38;5;124m'\u001B[39m])\n\u001B[0;32m      3\u001B[0m chi2, p, dof, expected \u001B[38;5;241m=\u001B[39m chi2_contingency(contingency)\n\u001B[0;32m      4\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mp 值: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;132;01m:\u001B[39;00m\u001B[38;5;124m.4f\u001B[39m\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:4102\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   4100\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[0;32m   4101\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[1;32m-> 4102\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mget_loc(key)\n\u001B[0;32m   4103\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[0;32m   4104\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m [indexer]\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3812\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3807\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(casted_key, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[0;32m   3808\u001B[0m         \u001B[38;5;28misinstance\u001B[39m(casted_key, abc\u001B[38;5;241m.\u001B[39mIterable)\n\u001B[0;32m   3809\u001B[0m         \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28many\u001B[39m(\u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;28;01mfor\u001B[39;00m x \u001B[38;5;129;01min\u001B[39;00m casted_key)\n\u001B[0;32m   3810\u001B[0m     ):\n\u001B[0;32m   3811\u001B[0m         \u001B[38;5;28;01mraise\u001B[39;00m InvalidIndexError(key)\n\u001B[1;32m-> 3812\u001B[0m     \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[0;32m   3813\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[0;32m   3814\u001B[0m     \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[0;32m   3815\u001B[0m     \u001B[38;5;66;03m#  InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[0;32m   3816\u001B[0m     \u001B[38;5;66;03m#  the TypeError.\u001B[39;00m\n\u001B[0;32m   3817\u001B[0m     \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Department'"
     ]
    }
   ],
   "source": [
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['Department'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)\n",
    "print(f\"p 值: {p:.4f}\")\n",
    "#p=0.0253,不显著\n",
    "#删除第三列\n",
    "x.drop(columns=['Department'],inplace=True)\n",
    "x.head()"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:23:21.750212200Z",
     "start_time": "2025-11-07T02:23:21.676509500Z"
    }
   },
   "id": "16a22b2cd33d83b3"
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 640x480 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkgAAAHTCAYAAADcV+eyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8fJSN1AAAACXBIWXMAAA9hAAAPYQGoP6dpAAByx0lEQVR4nO3deVyU5f7/8dewDTsCIiKCC4KaC6ZipWa5pOXWYrumfq2Tx+Vkp8XS0rRcWjx1jpW/U8dyOWlZZnnKLK0011wwl1wyBdxQEFEQQRiG+/cHMckAioLMIO/n4zEP5bqvue/PfXMzvLmX6zYZhmEgIiIiIjYuji5ARERExNkoIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIMkVadiwISaTCZPJhJubGyEhIdx444289NJLnDx58pLvX716NSaTiVtvvfXqF1sDDB061Pb9uNhr6NChji71oorWo6w6i/a7uXPnVmldV1tSUlKx75PZbKZevXrcfvvt/Pvf/yY3N/eS85g0aRImk4lJkyZd/YKvovKsR9F+kJSUVGV1XS59xlV/bo4uQKq3iIgIAgICOH78OJs2bWLTpk289dZbfPrpp9x+++0Oq2v16tWsXr2aW2+9tUZ9QAUGBhIZGVnm9ItNE+fQvHlzDMPgyJEjfPfdd3z33Xe89dZbLF++nMaNGzusrrlz55KUlMTQoUNp2LChw+pwhKKwVt3Dp1weBSSpkJdfftn21/769esZMWIEu3bt4u6772bnzp1ER0eX+j5vb2+aNm161X5hr169msmTJwPUqIDUv3//a+7oSk3zzTff0LBhQ/Ly8li8eDGjR49m//799O3bl+3bt+Ph4VHq+2rXrk3Tpk2pXbv2Valr7ty5/PTTT9x6661XNSBd7fW4EkWfJZcTkK72Z5xcfQpIUmk6derE6tWradmyJcePH2fChAl88sknpfbt0KED+/btq+IKRaoPDw8PHn74YRo2bEjnzp3Zu3cvH374IX/9619L7T969GhGjx5dxVVWvmtlPfQZV/3pGiSpVEFBQTz11FMALF26lHPnzjm4IpHqrWPHjvTu3RuABQsWOLgakZpDAUkqXdGH+fnz59mxY4eDqxGp/op+puLj47FarQ6uRqRmUECSShcdHY2bW+HZ27IOMV/OHR4rV66kV69eBAcHYzabiYqK4tFHHy1xB8utt95quwuo6JqByZMnF7s7qKxrCNasWUPfvn2pX78+Hh4ehIeHM2TIEA4dOlSib9G8ALZv306/fv2oXbs2gYGBdOvWjfj4+FKXsWfPHgYNGkRYWJhtGYMHD2b//v2l9i8oKODDDz+kc+fO+Pv74+XlRatWrXj99dexWCyX3G7lUbTNVq9eDcDXX3/NnXfeSf369ZkyZUqp7/n9998ZOnQo9erVw2w206RJE5577jlOnz5drF/RnUbx8fE88MAD+Pr60rJlS3799Vd+/PFHWrRoga+vL/369SMzM7NC61FQUMB7771HXFwc3t7e1KpVi549e/Ldd98V6zd37lzbXXKLFi0iOjoaPz8/xo4dy/nz5xk+fDh+fn5ERkayaNGiEsu42t+Pslx33XUA5OTklLpPQvnvYisoKOD//b//R1xcHL6+vvj4+NCiRQsmT57M2bNni/W98Gfnp59+AqBr167F2ov2nQsV3Y1YdD3cunXrePjhh2nQoAGPP/74Reu7nLvx8vPzeemll4iIiMDT05OWLVvyz3/+k4KCgmL9iu4SLOvaKftlFn0+Xfizbr89LmwvzeV8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D5T+l+3VcuONN+Lh4cHp06dLvb256Fb91q1bX/EvFEd/P7Zv327bdx599NEKzWv58uU89thjthHu3dzcaNGiBU8//TTjx48nNze3zMEoy/szVZX+97//lWgr2g9atWplays6ipWWllZi3924cSNr16696HKK3l/Z6+6MP1PyJwUkqTSbN2+mW7duHDp0iDp16hQLNlfCz8+PuXPnMm3aNL799ltbe0FBAcuXL7f9vzRRUVEAfPvtt2RnZ9vaExISil0rUnRdytatW20D8KWkpDB69OgKH50q8re//Q1PT0+WLl1qG28HIDs7myeeeILTp08TGRlpC1Kurq488cQTADz55JN8/fXXtnn98ssvtvGJHnnkkUqpr7xGjx6Nr68v69evZ9SoUbbteuzYMe677z7S0tJo0aIF/fv3r7KaatWqxYgRIwAYNmxYsVNE8+bNs12cPW7cuCtehqO+HxaLhcWLF9OrVy+sVitdu3bl/vvvr9A8c3Jy+OCDD3jhhRf4/fffbe3nzp2zXQt3qZ+pJUuWFGvfsGEDubm5FarrSs2aNavYeFXLly/nnXfeAQr/QCtSr149PD09OXfuHB999JGtfffu3dx33314eXlddDlF6/7555/b2iwWS4VPSTrjz5RcoMrul5NrStGtphEREUbLli2NkJAQ262wDRs2NHbs2HHR95f3Nv/nnnvONt/atWsb1113XbHxTsq6tTonJ8eIiYkxAMPf399o0aKFUb9+fcNkMhlffPGFrd/HH39sm1dISIjRpEkTw9XV1QCM9u3bG4Bx++23F5s3F7nlt+g28iFDhhRrX7x4se2Wc09PTyM6Otp2O7Kvr2+JW7ctFovRr18/27KCg4ONRo0a2caEuvPOO4vd+lt0W7X9ci/lcm7dNgzDWLZsmW1YBLPZbDRu3Ng2ZktkZKSxf/9+W9+ifaToNuTSbrW2316XWo/Shpc4f/680atXL9u2Cg8PNwIDA21fP//882Uu78JlXjhP+9ov9/txuS68zb958+ZG8+bNbWNxAUaPHj2MU6dOXXQe5bk93mKxGJ06dbLNNyIiwmjevLnte+rj42Ps2bOn1Pfu2rXL1i8sLMxo0aKFUbt2bQMwTp8+Xaxvadu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7OaQOSi4sLHTp04OuvvyYmJoY33njjokd9iq5dOnjwIAD16tUDKDFwJEBqamqx8ZLsmc1m/P39i71ERESk5nC6gGQYRrGvzWYzXbt2JSsri+TkZNLS0jh79myJ96WnpwN/HjGKjY0F/ryo+0KbN28mNDS0sksXERGRa4TTBKTTp08TFhbG1KlTS0w7c+YMACdPniQ0NJR58+aV6LN8+XIArrvuOgCio6OJjo5m/vz5xU6n7dy5kz179tClS5ersBYiIiJyLXCagBQYGEhERASvv/46u3btsrXv37+fpUuX0qpVK2644QYiIiJ47bXXOH78uK3Phg0bePPNN/H09OTee++1tY8ZM4bExESGDx9OdnY2x44dY9iwYRiGwcCBA6t0/URERKT6cKrb/N99911uvvlmbrjhBu699168vLxYvHgxJpOJf//737i4uPDGG2/wwAMP0Lx5c+Li4sjOzubnn3/GZDIxe/Zs6tata5vfyJEjWbNmDXPnzmXhwoVYrVasVitPPvkknTt3duCaioiIiDNzqoAUFxfHhg0bePHFF1m2bBnu7u50796dqVOnEh0dDcB9992Hn58fkyZNYt26dfj5+XHXXXcxduxYbrjhhmLzM5lMLFq0iD59+rBgwQIAhg4dykMPPVTl6yYiIiLVh1MFJIC2bdvyzTffXLTP7bffzu23317ueQ4ePJjBgwdXtDQRERGpIZzmGiQRERERZ6GAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYccqAtHLlSsaMGcOwYcN4/fXXOXHiRIk+8+bNo2XLlnh5edG+fXs2btxY6rz27t1L3759CQwMJCwsjGnTpl3t8kVERKSac7qANGbMGHr27MmCBQtYtWoVzz33HK1bt2b37t22PjNm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ixiYmLo0KGD7b1jxowhMTGR4cOHk52dzbFjxxg2bBiGYTBw4MAqX0cRERGpHpzqLrZ3332Xm2++mRtuuIF7770XLy8vFi9ejMlk4t///ret34IFC+jWrRv33HMPXl5e5OTk4O3tzZw5c2wjcEPhqNlr1qxh7ty5LFy4EKvVitVq5cknn6Rz586OWEURERGpBpwqIMXFxbFhwwZefPFFli1bhru7O927d2fq1KlER0fb+sXExLBz506mTZvGpk2baNiwIRMnTizWB8BkMrFo0SL69OnDggULABg6dCgPPfRQla6XiIiIVC9OFZAA2rZtyzfffHPJfkFBQcyYMaNc8xw8eDCDBw+uaGkiIiJSQzjNNUgiIiIizkIBSURERMSOApKIiIiIHQUkERERETsKSCIiIiJ2FJBERERE7CggiYiIiNhRQBIRERGxo4AkIiIiYkcBSURERMSOApKIiIiIHQUkERERETsKSCIiIiJ2FJBERERE7CggiYiIiNhRQBIRERGxo4AkIiIiYkcBSURERMSOApKIiIiIHQUkERERETsKSCIiIiJ2FJBERERE7CggiYiIiNhRQBIRERGxo4AkIiIiYkcBSURERMSOApKIiIiIHQUkERERETsKSCIiIiJ2FJBERERE7CggiYiIiNhRQBIRERGx43QBaceOHfTs2RN/f3/MZjMxMTF88sknxfrMnDkTk8lU6ispKalY371799K3b18CAwMJCwtj2rRpVbg2IiIiUh25ObqAC23fvp1OnTqRnZ3NDTfcgI+PD6tXr+ahhx7C3d2dAQMGALBt2zaCgoIYMWJEiXnUqlXL9v/9+/fTuXNnzp49y8CBAzEMgwkTJgAwfvz4KlknERERqX6cKiCNGjUKk8nE999/T/fu3QFYuXIlPXv25OWXX7YFpPj4eOLi4pgyZcpF5zd69GjS09NZunQp/fv3B6BFixZMnDiRQYMGERkZeXVXSERERKolpznFtm/fPjZv3syUKVNs4Qjgtttuo0WLFuzcuROr1UpOTg779u2jTZs2F53fkSNHWLlyJV27drWFI4CRI0fi4eHBkiVLrtaqiIiISDXnNAGpWbNmZGVlMWrUqBLTLBYLbm6FB7t27NhBfn4+cXFxF53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dx+++3lnu/gwYMZPHjwlZYlIiIiNYxTXYMkIiIi4gwUkERERETsKCCJiIiI2FFAEhEREbGjgCQiIiJiRwFJRERExI4CkoiIiIgdBSQREREROwpIIiIiInYUkERERETsKCCJiIiI2FFAEhEREbGjgCQiIiJiRwFJRERExI4CkoiIiIgdBSQREREROwpIIiIiInYUkERERETsKCCJiIiI2FFAEhEREbGjgCQiIiJiRwFJRERExI4CkoiIiIgdBSQREREROxUKSIcPHyYzM7PUaVarlTvvvJOJEydWZBEiIiIiVa5CAalRo0b84x//KHWaq6sr/v7+vP/++xVZhIiIiEiVq1BAMgwDwzDKnF6/fn1Onz5dkUWIiIiIVLmreg3Stm3baNiw4dVchIiIiEilc7vcN3Tr1q3Y1//9739Zt25diX6HDh0iKSmJt95668qrExEREXGAyw5ICQkJmEwm29dnzpwhMTGxWB8XFxciIyMZP348jz76aMWrFBEREalClx2QkpKSbP93cXHhb3/7Gy+//HJl1iQiIiLiUBoHSURERMROhQLSkCFDaNu2bWXVAsCOHTvo2bMn/v7+mM1mYmJi+OSTT0r0mzdvHi1btsTLy4v27duzcePGUue3d+9e+vbtS2BgIGFhYUybNq1S6xUREZFrz2WfYrvQnDlzKqsOALZv306nTp3Izs7mhhtuwMfHh9WrV/PQQw/h7u7OgAEDAJgxYwbPPvssDRo0YMSIEaxbt44ePXqwfft2oqOjbfPbv38/nTt35uzZswwcOBDDMJgwYQIA48ePr9TaRURE5NpRoYAEhXerffvtt6SmppY6JpLJZLKFkksZNWoUJpOJ77//nu7duwOwcuVKevbsycsvv8yAAQNISkrihRdeICoqii1bthAYGIjFYiEuLo4xY8bwzTff2OY3evRo0tPTWbp0Kf379wegRYsWTJw4kUGDBhEZGVnR1RcREZFrUIUC0rJly7j33nvJy8src8DI8gakffv2sXnzZt544w1bOAK47bbbaNGiBTt37sRqtTJ//nzy8vKYOHEigYGBALi7u/P0008zdOhQTp06RXBwMEeOHGHlypV07drVFo4ARo4cyZQpU1iyZAlPPvlkRVZfRERErlEV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RDI6dyeFAahYHcCds2LuczS1wdJk2CkgiIiJSZVxdTESH+hEd6kdaVi47jp5hb3IGRn4uvh7OcyTJxdEFiIiISM1U29dM92ah9A63cGrZW071cFwFJBEREXEoDxewnDri6DKKUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidmpEQDp9+jQjR44kPDwcPz8/hg4dSmZmpqPLEhERESfl5ugCrracnBx69erFli1b6NWrFzExMXz00UckJyezYsUKR5cnIiIiTuiaP4L01ltvsWXLFp566im+/fZbZs6cybfffsvKlSv59NNPHV2eiIiIOKFrPiDNnj0bX19fXn75ZVtbhw4d6NatGwsXLnRgZSIiIuKsrumAdOLECRITE+nWrRs+Pj7FpnXr1o3Vq1c7pjARERFxatd0QEpJSQGgdevWJaZFRUWRkZFBenp6VZclIiIiTu6avki76E61kJCQEtMCAgIASE5OJigoqNi03NxccnNzbV9nZGQUm19lysrKAuDo77vJzcmu9PlfqZTDBwE4kbSfgz7eDq6mkDPWBM5ZlzPWBM5ZlzPWBKrrcjhjTeCcdTljTQAnjyYChb8TK/N3bdG8DMO4/Dcb17ANGzYYgPH++++XmPb9998bgLFp06YS01566SUD0EsvvfTSSy+9roHXkSNHLjtDXNNHkIquOzp//nyJaRaLBYC8vLwS08aNG8dTTz1l+7qgoID09HSCg4MxmUzF+mZmZhIREcGRI0fw9/evzPJrBG2/itM2rBhtv4rTNqwYbb+KK2sbGobB2bNnqVev3mXP85oOSEUbJCkpqcS01NRUAGrVqlVimtlsxmw2F2srrd+F/P39tWNXgLZfxWkbVoy2X8VpG1aMtl/FlbYNiy6puVzX9EXatWvXJjw8nPj4+BLTNm/eDEBoaGhVlyUiIiJO7poOSAC9e/dm7dq1/Pbbb7a23NxcvvjiC5o1a1bqBdwiIiJSs13zAWnUqFG4uLjw8MMPc/ToUc6fP89f//pXkpOTGTRoUIXnbzabe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Z+/fvr9oCq4GLbcPly5cbN9xwg+Hp6WmEhIQY99xzj/Hzzz9XfZFOxt3d3fYMu9Jeq1atsvXVPli68m5D7YNli4+PN+644w4jKCjICA0NNe67775S96/K2gd1BElERETEji7SFhEREbGjgCQiIiJiRwFJRERExI4CkoiIiIgdBSQREREROwpIIiIiInYUkERERETsKCCJVGNJSUmYTCZMJhMuLi4EBwdz8803M2vWLCwWS6nvmTt3LiaTidWrV1dtsU7u1ltvtW3L0l5t2rRxdIkAmEymUkeanzRpEiaTiblz51Z9USLXIDdHFyAiFRcZGcmgQYNITk7m66+/ZtSoUSxevJhly5bh5eXl6PKqldGjRxMQEFCiPSwszAHViIijKCCJXAMaNWpke9L1mTNn6NOnD6tWrWLq1KlMmTKlWN+7776bG2+8kcjIyEpZ9sWeD1cdPf3009fEeohIxegUm8g1platWsyZMweTycS///1v8vPzi00PCAigWbNmeHt7O6hCERHnp4Akcg2KiYkhNjaWU6dOsW3bNkeXIyJS7SggiVyjWrVqBcDevXuLtZfnIu2PP/6Y9u3b4+/vT506dbjzzjvZs2ePbfrq1attFy9PnjwZKDzNV9Q2adKkEvN87733iI2NxcfHh8jISB577DHS0tKK9WnYsCGdO3cmOzubv/3tb9StW5datWpx5513cvz48WJ9rVYrb7zxBjExMXh5edG0aVPGjx/PuXPnSix727Zt9O3bl1q1auHt7U2PHj2Ij4+/6Pa7mKKL4ydNmoRhGPz73/+mffv2tGzZskTf06dP87e//Y2wsDA8PT2Ji4vjyy+/LNbHZDIxZMgQnn/+eQICAmjRogW///47jz/+OD4+PsTFxXHs2LErqnXevHnExsbi6elJZGQkzz//PNnZ2bbpQ4cOxWQy8cMPP9C0aVMCAgL44IMP+Pzzz6lfvz4hISF88sknxeb56aef0qFDB7y8vAgODmbIkCGkpKRcUX0izkrXIIlco0JDQwE4derUZb3vk08+4eGHH6Zx48YMGzaM3NxcPv30U2677TZ2795NrVq1aNCgAS+88AIAa9asYe3atcUubu7SpUuxeU6ZMoUJEyYQGxvLX//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VG/qg6OtHHnnksud599134+rqyj//+U+ysrJs7V9++SWjR48u9ZoukepK1yCJXAMSExN54YUXSElJ4euvvyYlJYWBAwcyZsyYy57Xo48+yquvvkqHDh3o0qULubm5fPbZZ5hMJu6+++4S/Xv37k1gYCBDhw7l3nvvJS8vj5UrV/Ltt9/SsGFDbr31VlxdXXn22WfZsWMHaWlpLF26FHd3d6DwlvXL9dBDD/HZZ5+xZMkS2rVrx6233sru3bv5/vvvueGGG2zhwMXFhffff5/evXvTtm1bBgwYgJ+fH4sXLyYvL69YcLkapkyZwg8//MDzzz/PqlWriIqKYunSpRw7dox//etfFTqdeCnt27dn3LhxTJ8+ndatW9O7d2927tzJmjVruOmmm4pdOF5ejRs3ZvLkybz44ou0bNmSPn36kJWVxaeffkp4ePgVzVPEWekIksg14PDhw0yfPp0vvviCVq1a8emnn/LRRx9d0dGRqVOn8u9//xuADz/8kI8++oimTZvy9ddfl7h4GqBOnTp89913NGrUiPfff58PPviAoKAg20W+bdu25dNPPyUiIoL333+fNWvW8Pjjj/PNN98A8MUXX1x2jSaTic8++4zp06dz7tw5Zs2axb59+3j66af54YcfbOELoFu3bqxbt46bb76ZJUuW8NFHH9GqVSvWrFlDt27dLnvZlyMgIID169czatQotm/fzgcffEBYWBhLliwpNgbS1TJt2jTmzp2Lr68v77//PgkJCYwdO5bvv/++2BhIl+OFF15g4cKFhISE8OGHH/L9999z//33s3HjRj3QV64pJuPCe0dFREREREeQREREROwpIImIiIjYUUASERERsaOAJCIiImJHAUlERETEjgKSiIiIiB0FJBERERE7CkgiIiIidhSQREREROwoIImIiIjYUUASERERsaOAJCIiImLn/wM34oRDVM5p5QAAAABJRU5ErkJggg=="
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#处理第四列\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "# 查看分布\n",
    "sns.histplot(x['DistanceFromHome'], kde=True)\n",
    "plt.title('DistanceFromHome Distribution')\n",
    "plt.show()\n",
    "#可以看出，距离 distributions 很集中，因此不需要进行分箱"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:23:34.050796400Z",
     "start_time": "2025-11-07T02:23:33.120335100Z"
    }
   },
   "id": "a1fc451af33509ff"
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "29\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\jinhao\\AppData\\Local\\Temp\\ipykernel_16368\\1437355450.py:5: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  x['DistanceFromHome_bin']=pd.qcut(x=x['DistanceFromHome'],q=4,labels=['0-7.5','7.5-15','15-22.5','22.5-29'])\n"
     ]
    },
    {
     "ename": "KeyError",
     "evalue": "'Attrition_bin'",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3805\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3804\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m-> 3805\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_engine\u001B[38;5;241m.\u001B[39mget_loc(casted_key)\n\u001B[0;32m   3806\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n",
      "File \u001B[1;32mindex.pyx:167\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mindex.pyx:196\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7081\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7089\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Attrition_bin'",
      "\nThe above exception was the direct cause of the following exception:\n",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[92], line 8\u001B[0m\n\u001B[0;32m      6\u001B[0m x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDistanceFromHome_bin\u001B[39m\u001B[38;5;124m'\u001B[39m]\n\u001B[0;32m      7\u001B[0m \u001B[38;5;66;03m#求卡方p值\u001B[39;00m\n\u001B[1;32m----> 8\u001B[0m contingency \u001B[38;5;241m=\u001B[39m pd\u001B[38;5;241m.\u001B[39mcrosstab(x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDistanceFromHome_bin\u001B[39m\u001B[38;5;124m'\u001B[39m], x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mAttrition_bin\u001B[39m\u001B[38;5;124m'\u001B[39m])\n\u001B[0;32m      9\u001B[0m chi2, p, dof, expected \u001B[38;5;241m=\u001B[39m chi2_contingency(contingency)\u001B[38;5;66;03m#p<0.05为显著,强相关\u001B[39;00m\n\u001B[0;32m     10\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mp 值: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mp\u001B[38;5;132;01m:\u001B[39;00m\u001B[38;5;124m.4f\u001B[39m\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:4102\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   4100\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[0;32m   4101\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[1;32m-> 4102\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mget_loc(key)\n\u001B[0;32m   4103\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[0;32m   4104\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m [indexer]\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3812\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3807\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(casted_key, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[0;32m   3808\u001B[0m         \u001B[38;5;28misinstance\u001B[39m(casted_key, abc\u001B[38;5;241m.\u001B[39mIterable)\n\u001B[0;32m   3809\u001B[0m         \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28many\u001B[39m(\u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;28;01mfor\u001B[39;00m x \u001B[38;5;129;01min\u001B[39;00m casted_key)\n\u001B[0;32m   3810\u001B[0m     ):\n\u001B[0;32m   3811\u001B[0m         \u001B[38;5;28;01mraise\u001B[39;00m InvalidIndexError(key)\n\u001B[1;32m-> 3812\u001B[0m     \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[0;32m   3813\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[0;32m   3814\u001B[0m     \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[0;32m   3815\u001B[0m     \u001B[38;5;66;03m#  InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[0;32m   3816\u001B[0m     \u001B[38;5;66;03m#  the TypeError.\u001B[39;00m\n\u001B[0;32m   3817\u001B[0m     \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Attrition_bin'"
     ]
    }
   ],
   "source": [
    "#进行逻辑回归数据处理\n",
    "#第四列进行分箱\n",
    "print(x['DistanceFromHome'].max())#29\n",
    "#通过最大值可以看出距离最大为29则分箱在0-30\n",
    "x['DistanceFromHome_bin']=pd.qcut(x=x['DistanceFromHome'],q=4,labels=['0-7.5','7.5-15','15-22.5','22.5-29'])\n",
    "x['DistanceFromHome_bin']\n",
    "#求卡方p值\n",
    "contingency = pd.crosstab(x['DistanceFromHome_bin'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)#p<0.05为显著,强相关\n",
    "print(f\"p 值: {p:.4f}\")#0.0230,显著"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T09:09:40.098360800Z",
     "start_time": "2025-11-07T09:09:39.793035Z"
    }
   },
   "id": "46f2533175c36920"
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "箱: 0-7.5 | WOE: 0.2370 | IV: 0.0143\n",
      "箱: 7.5-15 | WOE: 0.2262 | IV: 0.0113\n",
      "箱: 15-22.5 | WOE: -0.0606 | IV: 0.0009\n",
      "箱: 22.5-29 | WOE: -0.3593 | IV: 0.0340\n",
      "\n",
      "总 IV (特征预测力): 0.0606\n"
     ]
    },
    {
     "ename": "KeyError",
     "evalue": "\"[('DistanceFromHome_bin',), ('age_bin',)] not found in axis\"",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[70], line 35\u001B[0m\n\u001B[0;32m     33\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[38;5;124m总 IV (特征预测力): \u001B[39m\u001B[38;5;132;01m{\u001B[39;00miv_total\u001B[38;5;132;01m:\u001B[39;00m\u001B[38;5;124m.4f\u001B[39m\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m)\n\u001B[0;32m     34\u001B[0m x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDistanceFromHome_WOE\u001B[39m\u001B[38;5;124m'\u001B[39m] \u001B[38;5;241m=\u001B[39m x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDistanceFromHome_bin\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m.\u001B[39mmap(woe_map)\n\u001B[1;32m---> 35\u001B[0m x\u001B[38;5;241m.\u001B[39mdrop(columns\u001B[38;5;241m=\u001B[39m[[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mDistanceFromHome_bin\u001B[39m\u001B[38;5;124m'\u001B[39m],[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mage_bin\u001B[39m\u001B[38;5;124m'\u001B[39m]],inplace\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:5581\u001B[0m, in \u001B[0;36mDataFrame.drop\u001B[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001B[0m\n\u001B[0;32m   5433\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mdrop\u001B[39m(\n\u001B[0;32m   5434\u001B[0m     \u001B[38;5;28mself\u001B[39m,\n\u001B[0;32m   5435\u001B[0m     labels: IndexLabel \u001B[38;5;241m|\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[1;32m   (...)\u001B[0m\n\u001B[0;32m   5442\u001B[0m     errors: IgnoreRaise \u001B[38;5;241m=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mraise\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[0;32m   5443\u001B[0m ) \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m>\u001B[39m DataFrame \u001B[38;5;241m|\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m   5444\u001B[0m \u001B[38;5;250m    \u001B[39m\u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[0;32m   5445\u001B[0m \u001B[38;5;124;03m    Drop specified labels from rows or columns.\u001B[39;00m\n\u001B[0;32m   5446\u001B[0m \n\u001B[1;32m   (...)\u001B[0m\n\u001B[0;32m   5579\u001B[0m \u001B[38;5;124;03m            weight  1.0     0.8\u001B[39;00m\n\u001B[0;32m   5580\u001B[0m \u001B[38;5;124;03m    \"\"\"\u001B[39;00m\n\u001B[1;32m-> 5581\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28msuper\u001B[39m()\u001B[38;5;241m.\u001B[39mdrop(\n\u001B[0;32m   5582\u001B[0m         labels\u001B[38;5;241m=\u001B[39mlabels,\n\u001B[0;32m   5583\u001B[0m         axis\u001B[38;5;241m=\u001B[39maxis,\n\u001B[0;32m   5584\u001B[0m         index\u001B[38;5;241m=\u001B[39mindex,\n\u001B[0;32m   5585\u001B[0m         columns\u001B[38;5;241m=\u001B[39mcolumns,\n\u001B[0;32m   5586\u001B[0m         level\u001B[38;5;241m=\u001B[39mlevel,\n\u001B[0;32m   5587\u001B[0m         inplace\u001B[38;5;241m=\u001B[39minplace,\n\u001B[0;32m   5588\u001B[0m         errors\u001B[38;5;241m=\u001B[39merrors,\n\u001B[0;32m   5589\u001B[0m     )\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\generic.py:4788\u001B[0m, in \u001B[0;36mNDFrame.drop\u001B[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001B[0m\n\u001B[0;32m   4786\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m axis, labels \u001B[38;5;129;01min\u001B[39;00m axes\u001B[38;5;241m.\u001B[39mitems():\n\u001B[0;32m   4787\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m labels \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m-> 4788\u001B[0m         obj \u001B[38;5;241m=\u001B[39m obj\u001B[38;5;241m.\u001B[39m_drop_axis(labels, axis, level\u001B[38;5;241m=\u001B[39mlevel, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4790\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m inplace:\n\u001B[0;32m   4791\u001B[0m     \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_update_inplace(obj)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\generic.py:4830\u001B[0m, in \u001B[0;36mNDFrame._drop_axis\u001B[1;34m(self, labels, axis, level, errors, only_slice)\u001B[0m\n\u001B[0;32m   4828\u001B[0m         new_axis \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mdrop(labels, level\u001B[38;5;241m=\u001B[39mlevel, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4829\u001B[0m     \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m-> 4830\u001B[0m         new_axis \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mdrop(labels, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4831\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mget_indexer(new_axis)\n\u001B[0;32m   4833\u001B[0m \u001B[38;5;66;03m# Case for non-unique axis\u001B[39;00m\n\u001B[0;32m   4834\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:7070\u001B[0m, in \u001B[0;36mIndex.drop\u001B[1;34m(self, labels, errors)\u001B[0m\n\u001B[0;32m   7068\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m mask\u001B[38;5;241m.\u001B[39many():\n\u001B[0;32m   7069\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m errors \u001B[38;5;241m!=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mignore\u001B[39m\u001B[38;5;124m\"\u001B[39m:\n\u001B[1;32m-> 7070\u001B[0m         \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mlabels[mask]\u001B[38;5;241m.\u001B[39mtolist()\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m not found in axis\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[0;32m   7071\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m indexer[\u001B[38;5;241m~\u001B[39mmask]\n\u001B[0;32m   7072\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdelete(indexer)\n",
      "\u001B[1;31mKeyError\u001B[0m: \"[('DistanceFromHome_bin',), ('age_bin',)] not found in axis\""
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "# 构建列联表：每箱中的流失(1)和未流失(0)人数\n",
    "crosstab = pd.crosstab(x['DistanceFromHome_bin'], x['Attrition_bin'])\n",
    "\n",
    "# 加平滑（避免0导致无穷大）\n",
    "crosstab = crosstab + 0.5\n",
    "\n",
    "# 计算总体 good（未流失）和 bad（流失）总数\n",
    "total_good = crosstab[0].sum()   # Attrition=0 的总数\n",
    "total_bad = crosstab[1].sum()    # Attrition=1 的总数\n",
    "\n",
    "# 计算 WOE\n",
    "woe_map = {}\n",
    "iv_total = 0  # 可选：计算 IV（信息价值）评估特征强度\n",
    "\n",
    "for bin_label in crosstab.index:\n",
    "    good = crosstab.loc[bin_label, 0]\n",
    "    bad = crosstab.loc[bin_label, 1]\n",
    "    \n",
    "    pct_good = good / total_good\n",
    "    pct_bad = bad / total_bad\n",
    "    \n",
    "    woe = np.log(pct_good / pct_bad)\n",
    "    iv = (pct_good - pct_bad) * woe\n",
    "    \n",
    "    woe_map[bin_label] = woe\n",
    "    iv_total += iv\n",
    "    \n",
    "    print(f\"箱: {bin_label} | WOE: {woe:.4f} | IV: {iv:.4f}\")\n",
    "\n",
    "print(f\"\\n总 IV (特征预测力): {iv_total:.4f}\")\n",
    "x['DistanceFromHome_WOE'] = x['DistanceFromHome_bin'].map(woe_map)\n",
    "x.drop(columns=[['DistanceFromHome_bin'],['age_bin']],inplace=True)#删除无用列"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:37:26.198032300Z",
     "start_time": "2025-11-07T02:37:26.118534300Z"
    }
   },
   "id": "db28d57c6f9e6efe"
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'Education'",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3805\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3804\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m-> 3805\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_engine\u001B[38;5;241m.\u001B[39mget_loc(casted_key)\n\u001B[0;32m   3806\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n",
      "File \u001B[1;32mindex.pyx:167\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mindex.pyx:196\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7081\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "File \u001B[1;32mpandas\\\\_libs\\\\hashtable_class_helper.pxi:7089\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Education'",
      "\nThe above exception was the direct cause of the following exception:\n",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[76], line 2\u001B[0m\n\u001B[0;32m      1\u001B[0m \u001B[38;5;66;03m#处理第五列\u001B[39;00m\n\u001B[1;32m----> 2\u001B[0m x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mEducation\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m=\u001B[39mle\u001B[38;5;241m.\u001B[39mfit_transform(x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mEducation\u001B[39m\u001B[38;5;124m'\u001B[39m])\n\u001B[0;32m      3\u001B[0m \u001B[38;5;66;03m#卡方求p值\u001B[39;00m\n\u001B[0;32m      4\u001B[0m contingency \u001B[38;5;241m=\u001B[39m pd\u001B[38;5;241m.\u001B[39mcrosstab(x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mEducation\u001B[39m\u001B[38;5;124m'\u001B[39m], x[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mAttrition_bin\u001B[39m\u001B[38;5;124m'\u001B[39m])\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:4102\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   4100\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[0;32m   4101\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[1;32m-> 4102\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mget_loc(key)\n\u001B[0;32m   4103\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[0;32m   4104\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m [indexer]\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3812\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m   3807\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(casted_key, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[0;32m   3808\u001B[0m         \u001B[38;5;28misinstance\u001B[39m(casted_key, abc\u001B[38;5;241m.\u001B[39mIterable)\n\u001B[0;32m   3809\u001B[0m         \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28many\u001B[39m(\u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;28;01mfor\u001B[39;00m x \u001B[38;5;129;01min\u001B[39;00m casted_key)\n\u001B[0;32m   3810\u001B[0m     ):\n\u001B[0;32m   3811\u001B[0m         \u001B[38;5;28;01mraise\u001B[39;00m InvalidIndexError(key)\n\u001B[1;32m-> 3812\u001B[0m     \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[0;32m   3813\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[0;32m   3814\u001B[0m     \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[0;32m   3815\u001B[0m     \u001B[38;5;66;03m#  InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[0;32m   3816\u001B[0m     \u001B[38;5;66;03m#  the TypeError.\u001B[39;00m\n\u001B[0;32m   3817\u001B[0m     \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n",
      "\u001B[1;31mKeyError\u001B[0m: 'Education'"
     ]
    }
   ],
   "source": [
    "#处理第五列\n",
    "x['Education']=le.fit_transform(x['Education'])\n",
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['Education'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)#p<0.05为显著,强相关\n",
    "print(f\"p 值: {p:.4f}\")#0.1910,不显著\n",
    "#删除EDUACTION列\n",
    "x.drop(columns=['Education'],inplace=True)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:39:40.444326800Z",
     "start_time": "2025-11-07T02:39:40.373927900Z"
    }
   },
   "id": "31fde0a0452b9d76"
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p 值: 0.0240\n"
     ]
    }
   ],
   "source": [
    "#处理第六列\n",
    "x['EducationField']=le.fit_transform(x['EducationField'])\n",
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['EducationField'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)#p<0.05为显著,强相关\n",
    "print(f\"p 值: {p:.4f}\")#p=0.0240,显著\n",
    "#保留"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:41:32.934453800Z",
     "start_time": "2025-11-07T02:41:32.897861700Z"
    }
   },
   "id": "b363f7be40ef04fa"
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "\"['EmployeeNumber'] not found in axis\"",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mKeyError\u001B[0m                                  Traceback (most recent call last)",
      "Cell \u001B[1;32mIn[83], line 3\u001B[0m\n\u001B[0;32m      1\u001B[0m \u001B[38;5;66;03m#处理第七列\u001B[39;00m\n\u001B[0;32m      2\u001B[0m \u001B[38;5;66;03m#员工编号直接删除\u001B[39;00m\n\u001B[1;32m----> 3\u001B[0m x\u001B[38;5;241m.\u001B[39mdrop(columns\u001B[38;5;241m=\u001B[39m[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mEmployeeNumber\u001B[39m\u001B[38;5;124m'\u001B[39m],inplace\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\frame.py:5581\u001B[0m, in \u001B[0;36mDataFrame.drop\u001B[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001B[0m\n\u001B[0;32m   5433\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mdrop\u001B[39m(\n\u001B[0;32m   5434\u001B[0m     \u001B[38;5;28mself\u001B[39m,\n\u001B[0;32m   5435\u001B[0m     labels: IndexLabel \u001B[38;5;241m|\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[1;32m   (...)\u001B[0m\n\u001B[0;32m   5442\u001B[0m     errors: IgnoreRaise \u001B[38;5;241m=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mraise\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[0;32m   5443\u001B[0m ) \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m>\u001B[39m DataFrame \u001B[38;5;241m|\u001B[39m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m   5444\u001B[0m \u001B[38;5;250m    \u001B[39m\u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[0;32m   5445\u001B[0m \u001B[38;5;124;03m    Drop specified labels from rows or columns.\u001B[39;00m\n\u001B[0;32m   5446\u001B[0m \n\u001B[1;32m   (...)\u001B[0m\n\u001B[0;32m   5579\u001B[0m \u001B[38;5;124;03m            weight  1.0     0.8\u001B[39;00m\n\u001B[0;32m   5580\u001B[0m \u001B[38;5;124;03m    \"\"\"\u001B[39;00m\n\u001B[1;32m-> 5581\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28msuper\u001B[39m()\u001B[38;5;241m.\u001B[39mdrop(\n\u001B[0;32m   5582\u001B[0m         labels\u001B[38;5;241m=\u001B[39mlabels,\n\u001B[0;32m   5583\u001B[0m         axis\u001B[38;5;241m=\u001B[39maxis,\n\u001B[0;32m   5584\u001B[0m         index\u001B[38;5;241m=\u001B[39mindex,\n\u001B[0;32m   5585\u001B[0m         columns\u001B[38;5;241m=\u001B[39mcolumns,\n\u001B[0;32m   5586\u001B[0m         level\u001B[38;5;241m=\u001B[39mlevel,\n\u001B[0;32m   5587\u001B[0m         inplace\u001B[38;5;241m=\u001B[39minplace,\n\u001B[0;32m   5588\u001B[0m         errors\u001B[38;5;241m=\u001B[39merrors,\n\u001B[0;32m   5589\u001B[0m     )\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\generic.py:4788\u001B[0m, in \u001B[0;36mNDFrame.drop\u001B[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001B[0m\n\u001B[0;32m   4786\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m axis, labels \u001B[38;5;129;01min\u001B[39;00m axes\u001B[38;5;241m.\u001B[39mitems():\n\u001B[0;32m   4787\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m labels \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m-> 4788\u001B[0m         obj \u001B[38;5;241m=\u001B[39m obj\u001B[38;5;241m.\u001B[39m_drop_axis(labels, axis, level\u001B[38;5;241m=\u001B[39mlevel, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4790\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m inplace:\n\u001B[0;32m   4791\u001B[0m     \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_update_inplace(obj)\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\generic.py:4830\u001B[0m, in \u001B[0;36mNDFrame._drop_axis\u001B[1;34m(self, labels, axis, level, errors, only_slice)\u001B[0m\n\u001B[0;32m   4828\u001B[0m         new_axis \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mdrop(labels, level\u001B[38;5;241m=\u001B[39mlevel, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4829\u001B[0m     \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m-> 4830\u001B[0m         new_axis \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mdrop(labels, errors\u001B[38;5;241m=\u001B[39merrors)\n\u001B[0;32m   4831\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m axis\u001B[38;5;241m.\u001B[39mget_indexer(new_axis)\n\u001B[0;32m   4833\u001B[0m \u001B[38;5;66;03m# Case for non-unique axis\u001B[39;00m\n\u001B[0;32m   4834\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n",
      "File \u001B[1;32mE:\\AIPython\\softW\\anaconda3\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:7070\u001B[0m, in \u001B[0;36mIndex.drop\u001B[1;34m(self, labels, errors)\u001B[0m\n\u001B[0;32m   7068\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m mask\u001B[38;5;241m.\u001B[39many():\n\u001B[0;32m   7069\u001B[0m     \u001B[38;5;28;01mif\u001B[39;00m errors \u001B[38;5;241m!=\u001B[39m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mignore\u001B[39m\u001B[38;5;124m\"\u001B[39m:\n\u001B[1;32m-> 7070\u001B[0m         \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(\u001B[38;5;124mf\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mlabels[mask]\u001B[38;5;241m.\u001B[39mtolist()\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m not found in axis\u001B[39m\u001B[38;5;124m\"\u001B[39m)\n\u001B[0;32m   7071\u001B[0m     indexer \u001B[38;5;241m=\u001B[39m indexer[\u001B[38;5;241m~\u001B[39mmask]\n\u001B[0;32m   7072\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mdelete(indexer)\n",
      "\u001B[1;31mKeyError\u001B[0m: \"['EmployeeNumber'] not found in axis\""
     ]
    }
   ],
   "source": [
    "#处理第七列\n",
    "#员工编号直接删除\n",
    "x.drop(columns=['EmployeeNumber'],inplace=True)\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:45:09.531652300Z",
     "start_time": "2025-11-07T02:45:09.459209300Z"
    }
   },
   "id": "59a97a2e7327f64f"
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p 值: 0.0021\n"
     ]
    }
   ],
   "source": [
    "#处理第八列\n",
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['EnvironmentSatisfaction'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)#p<0.05为显著,强相关\n",
    "print(f\"p 值: {p:.4f}\")#p=0.0021,显著"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:45:11.107360700Z",
     "start_time": "2025-11-07T02:45:11.074905500Z"
    }
   },
   "id": "a8a442c18c588a2c"
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "p 值: 0.6368\n"
     ]
    }
   ],
   "source": [
    "#处理第九列\n",
    "x['Gender']=le.fit_transform(x['Gender'])\n",
    "#卡方求p值\n",
    "contingency = pd.crosstab(x['Gender'], x['Attrition_bin'])\n",
    "chi2, p, dof, expected = chi2_contingency(contingency)#p<0.05为显著,强相关\n",
    "print(f\"p 值: {p:.4f}\")#p=0.6368,不显著"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T02:46:01.781760300Z",
     "start_time": "2025-11-07T02:46:01.747213500Z"
    }
   },
   "id": "dd03961891ab6439"
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Age': 0.351735967242682, 'BusinessTravel': 0.5618800116990421, 'Department': 0.5529229325598966, 'DistanceFromHome': 0.5678392112895756, 'Education': 0.5448737478368959, 'EducationField': 0.5697128860074582, 'EnvironmentSatisfaction': 0.5719430159155721, 'JobInvolvement': 0.5717967778888103, 'JobLevel': 0.6514568963416121, 'JobRole': 0.662561846498818, 'JobSatisfaction': 0.5937873211630798, 'MaritalStatus': 0.6301518438177874, 'MonthlyIncome': 0.3448505934826586, 'NumCompaniesWorked': 0.5983298398693607, 'OverTime': 0.6624826342343221, 'PercentSalaryHike': 0.5070894976723781, 'PerformanceRating': 0.5228375051792635, 'RelationshipSatisfaction': 0.54057191254966, 'StockOptionLevel': 0.6597772307392332, 'TotalWorkingYears': 0.3344037144458797, 'TrainingTimesLastYear': 0.47020400204733237}\n",
      "{'Age': 0.351735967242682, 'BusinessTravel': 0.5618800116990421, 'Department': 0.5529229325598966, 'DistanceFromHome': 0.5678392112895756, 'Education': 0.5448737478368959, 'EducationField': 0.5697128860074582, 'EnvironmentSatisfaction': 0.5719430159155721, 'JobInvolvement': 0.5717967778888103, 'JobLevel': 0.6514568963416121, 'JobRole': 0.662561846498818, 'JobSatisfaction': 0.5937873211630798, 'MaritalStatus': 0.6301518438177874, 'MonthlyIncome': 0.3448505934826586, 'NumCompaniesWorked': 0.5983298398693607, 'OverTime': 0.6624826342343221, 'PercentSalaryHike': 0.5070894976723781, 'PerformanceRating': 0.5228375051792635, 'RelationshipSatisfaction': 0.54057191254966, 'StockOptionLevel': 0.6597772307392332, 'TotalWorkingYears': 0.3344037144458797, 'TrainingTimesLastYear': 0.47020400204733237}\n"
     ]
    },
    {
     "data": {
      "text/plain": "      Age     BusinessTravel              Department  DistanceFromHome  \\\n0      37      Travel_Rarely  Research & Development                 1   \n1      54  Travel_Frequently  Research & Development                 1   \n2      34  Travel_Frequently  Research & Development                 7   \n3      39      Travel_Rarely  Research & Development                 1   \n4      28  Travel_Frequently  Research & Development                 1   \n...   ...                ...                     ...               ...   \n1095   35      Travel_Rarely  Research & Development                23   \n1096   38      Travel_Rarely                   Sales                 2   \n1097   37      Travel_Rarely                   Sales                16   \n1098   22      Travel_Rarely  Research & Development                 7   \n1099   26  Travel_Frequently  Research & Development                 2   \n\n      Education EducationField  EnvironmentSatisfaction  JobInvolvement  \\\n0             4  Life Sciences                        1               2   \n1             4  Life Sciences                        4               3   \n2             3  Life Sciences                        1               1   \n3             1  Life Sciences                        4               2   \n4             3        Medical                        1               2   \n...         ...            ...                      ...             ...   \n1095          4        Medical                        3               3   \n1096          4      Marketing                        2               1   \n1097          4      Marketing                        4               2   \n1098          1  Life Sciences                        4               3   \n1099          3  Life Sciences                        1               3   \n\n      JobLevel                 JobRole  JobSatisfaction MaritalStatus  \\\n0            2  Manufacturing Director                3      Divorced   \n1            3  Manufacturing Director                3      Divorced   \n2            2   Laboratory Technician                3        Single   \n3            4  Manufacturing Director                4       Married   \n4            1   Laboratory Technician                2      Divorced   \n...        ...                     ...              ...           ...   \n1095         1   Laboratory Technician                1       Married   \n1096         2    Sales Representative                4       Married   \n1097         2         Sales Executive                3      Divorced   \n1098         1      Research Scientist                2        Single   \n1099         1      Research Scientist                1       Married   \n\n      MonthlyIncome  NumCompaniesWorked OverTime  PerformanceRating  \\\n0              5993                   1       No                  3   \n1             10502                   7       No                  3   \n2              6074                   1      Yes                  4   \n3             12742                   1       No                  3   \n4              2596                   1       No                  3   \n...             ...                 ...      ...                ...   \n1095           4014                   3      Yes                  3   \n1096           5405                   2      Yes                  4   \n1097           6334                   4       No                  3   \n1098           2472                   1      Yes                  4   \n1099           2042                   6      Yes                  3   \n\n      RelationshipSatisfaction  StockOptionLevel  TotalWorkingYears  \\\n0                            3                 1                  7   \n1                            1                 1                 33   \n2                            4                 0                  9   \n3                            3                 1                 21   \n4                            1                 2                  1   \n...                        ...               ...                ...   \n1095                         3                 1                  4   \n1096                         1                 2                 20   \n1097                         4                 2                  9   \n1098                         1                 0                  1   \n1099                         2                 1                  6   \n\n      TrainingTimesLastYear  \n0                         2  \n1                         2  \n2                         3  \n3                         3  \n4                         2  \n...                     ...  \n1095                      3  \n1096                      4  \n1097                      2  \n1098                      2  \n1099                      2  \n\n[1100 rows x 20 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Age</th>\n      <th>BusinessTravel</th>\n      <th>Department</th>\n      <th>DistanceFromHome</th>\n      <th>Education</th>\n      <th>EducationField</th>\n      <th>EnvironmentSatisfaction</th>\n      <th>JobInvolvement</th>\n      <th>JobLevel</th>\n      <th>JobRole</th>\n      <th>JobSatisfaction</th>\n      <th>MaritalStatus</th>\n      <th>MonthlyIncome</th>\n      <th>NumCompaniesWorked</th>\n      <th>OverTime</th>\n      <th>PerformanceRating</th>\n      <th>RelationshipSatisfaction</th>\n      <th>StockOptionLevel</th>\n      <th>TotalWorkingYears</th>\n      <th>TrainingTimesLastYear</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>1</td>\n      <td>2</td>\n      <td>2</td>\n      <td>Manufacturing Director</td>\n      <td>3</td>\n      <td>Divorced</td>\n      <td>5993</td>\n      <td>1</td>\n      <td>No</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>7</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>54</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>4</td>\n      <td>Life Sciences</td>\n      <td>4</td>\n      <td>3</td>\n      <td>3</td>\n      <td>Manufacturing Director</td>\n      <td>3</td>\n      <td>Divorced</td>\n      <td>10502</td>\n      <td>7</td>\n      <td>No</td>\n      <td>3</td>\n      <td>1</td>\n      <td>1</td>\n      <td>33</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>34</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1</td>\n      <td>1</td>\n      <td>2</td>\n      <td>Laboratory Technician</td>\n      <td>3</td>\n      <td>Single</td>\n      <td>6074</td>\n      <td>1</td>\n      <td>Yes</td>\n      <td>4</td>\n      <td>4</td>\n      <td>0</td>\n      <td>9</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>39</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>4</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Manufacturing Director</td>\n      <td>4</td>\n      <td>Married</td>\n      <td>12742</td>\n      <td>1</td>\n      <td>No</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>21</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>28</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>1</td>\n      <td>3</td>\n      <td>Medical</td>\n      <td>1</td>\n      <td>2</td>\n      <td>1</td>\n      <td>Laboratory Technician</td>\n      <td>2</td>\n      <td>Divorced</td>\n      <td>2596</td>\n      <td>1</td>\n      <td>No</td>\n      <td>3</td>\n      <td>1</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1095</th>\n      <td>35</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>23</td>\n      <td>4</td>\n      <td>Medical</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>Laboratory Technician</td>\n      <td>1</td>\n      <td>Married</td>\n      <td>4014</td>\n      <td>3</td>\n      <td>Yes</td>\n      <td>3</td>\n      <td>3</td>\n      <td>1</td>\n      <td>4</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>1096</th>\n      <td>38</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>2</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>2</td>\n      <td>1</td>\n      <td>2</td>\n      <td>Sales Representative</td>\n      <td>4</td>\n      <td>Married</td>\n      <td>5405</td>\n      <td>2</td>\n      <td>Yes</td>\n      <td>4</td>\n      <td>1</td>\n      <td>2</td>\n      <td>20</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>1097</th>\n      <td>37</td>\n      <td>Travel_Rarely</td>\n      <td>Sales</td>\n      <td>16</td>\n      <td>4</td>\n      <td>Marketing</td>\n      <td>4</td>\n      <td>2</td>\n      <td>2</td>\n      <td>Sales Executive</td>\n      <td>3</td>\n      <td>Divorced</td>\n      <td>6334</td>\n      <td>4</td>\n      <td>No</td>\n      <td>3</td>\n      <td>4</td>\n      <td>2</td>\n      <td>9</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1098</th>\n      <td>22</td>\n      <td>Travel_Rarely</td>\n      <td>Research &amp; Development</td>\n      <td>7</td>\n      <td>1</td>\n      <td>Life Sciences</td>\n      <td>4</td>\n      <td>3</td>\n      <td>1</td>\n      <td>Research Scientist</td>\n      <td>2</td>\n      <td>Single</td>\n      <td>2472</td>\n      <td>1</td>\n      <td>Yes</td>\n      <td>4</td>\n      <td>1</td>\n      <td>0</td>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1099</th>\n      <td>26</td>\n      <td>Travel_Frequently</td>\n      <td>Research &amp; Development</td>\n      <td>2</td>\n      <td>3</td>\n      <td>Life Sciences</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1</td>\n      <td>Research Scientist</td>\n      <td>1</td>\n      <td>Married</td>\n      <td>2042</td>\n      <td>6</td>\n      <td>Yes</td>\n      <td>3</td>\n      <td>2</td>\n      <td>1</td>\n      <td>6</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n<p>1100 rows × 20 columns</p>\n</div>"
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import datetime\n",
    "import predict\n",
    "import numpy as np\n",
    "from util.logUtil import Logger\n",
    "from util.commonUtil import data_preprocessing\n",
    "from sklearn.metrics import mean_absolute_error\n",
    "import matplotlib.ticker as mick\n",
    "import joblib\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.preprocessing import LabelEncoder  # 文字分类\n",
    "\n",
    "data = pd.read_csv('../data/train.csv')\n",
    "predict.Cleaning_data()  # 数据预处理\n",
    "y = data['Attrition']  # 获取标签列\n",
    "x = data[list(predict.Cleaning_data().keys())] \n",
    "x"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2025-11-07T06:25:23.840541700Z",
     "start_time": "2025-11-07T06:25:23.701325700Z"
    }
   },
   "id": "9d9ebdc446673165"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "26aeb653b7d6d4c9"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
